local Class_ObjectPool = class()
ObjectPool = Class_ObjectPool.new()

function Class_ObjectPool:Init()
    self.Objects = {}
end

function Class_ObjectPool:PushToPool(key, obj)
    if LuaUtils:IsNil(obj) then
        return
    end
    obj:SetActive(false)
    
    if self.Objects[key] == nil then
        self.Objects[key] = {}
    end
    table.insert(self.Objects[key], obj)
end

function Class_ObjectPool:PullFromPool(key)
    local item = nil
    if self.Objects[key] ~= nil then
        if #self.Objects[key] > 0 then
            item = table.remove(self.Objects, key)
        end
    end
    return item
end
